package com.anycl.spring.property;

import com.anycl.spring.soundsystem.BlankDisc;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.core.env.Environment;

@Configuration
@PropertySource("classpath:/soundsystem/app.properties")
@ComponentScan("com.anycl.spring")
public class ExpressiveConfig {

    @Autowired
    private Environment env;

   /* @Bean
    public BlankDisc blankDisc() {
        return new BlankDisc(
                env.getProperty("blankdisc.title", "Blank"),
                env.getProperty("blankdisc.artist", "Blank")
        );
    }*/

    /**
     * 不配置属性占位符也可以生效
     * @return
     */
/*   @Bean
    public PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer( ){
        return new PropertySourcesPlaceholderConfigurer();
    }*/
}
